<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>后台管理</title>
{{include file="layouts/_head"}}
<style type="text/css">
.set_menu a {
    font-weight: 600;
}
.set_menu a:hover {
    color: #777 !important;
}
.set_menu a:visited {
    color: #777 !important;
}
.set_menu li.active a {
    color: #333 !important;
}
</style>
</head>
<body>
<div class="main">
	<ol class="breadcrumb">
        <li><i class="icon_home iconfont"></i>首页</li>  
	  	<li>设置中心</li>
	  	<li class="active">系统设置</li>
	</ol>
	<div class="bg-danger clearfix main-head-info error-info"></div>
    <nav class="navbar navbar-default set_menu">
        <ul class="nav navbar-nav">
            <li><a href="{{:url('/admin/set/system')}}">基础配置</a></li>
            <li><a href="{{:url('/admin/set/payment')}}?id=1">支付方式</a></li>
            <li><a href="{{:url('/admin/set/oauth')}}?id=qq">互联登录</a></li>
            <li><a href="{{:url('/admin/set/sms')}}">短信设置</a></li>
            <li><a href="{{:url('/admin/set/mail')}}">邮件设置</a></li>
            <li class="active"><a href="{{:url('/admin/set/client')}}?id=wx_app">应用配置</a></li>
        </ul>
    </nav>
	<div class="main-con">
		<ul class="nav nav-tabs" >
            <li class="active"><a href="{{:url('/admin/set/client')}}?id=wx_app">微信小程序</a></li>
        </ul>
		<form class="form-horizontal margin-t-30" id="form" method="post" action="{{:url('/admin/set/client')}}" autocomplete="off">
            {{:token()}}
            <input type="hidden" name="id" value="{{:Request()->id}}">
		  	<div class="tab-box">
                <div class="form-group">
                    <span class="col-sm-2 control-label">小程序名字：</span>
                    <div class="col-sm-8 input-group"><input class="form-control" name="name" value="{{$client.wx_app.name}}"></div>
                </div>
                <div class="form-group">
                    <span class="col-sm-2 control-label"><i class="iconfont iconfont-question" data-toggle="tooltip" data-placement="top" data-original-title="客户端展示二维码"></i> 二维码：</span>
                    <div class="col-sm-4 input-group">
                        {{if !empty($client.wx_app.qrcode)}}
                        <div class="fmr wh-80x80 uploaded" data-name="qrcode">
                            <input name="qrcode" type="hidden" value="{{$client.wx_app.qrcode}}"><img src="{{$client.wx_app.qrcode}}"><i class="iconfont fmr_remove"></i>
                        </div>
                        {{else}}
                        <div class="fmr wh-80x80" data-name="qrcode"></div>
                        {{/if}}
                    </div>
                </div>
                <div class="form-group">
                    <span class="col-sm-2 control-label">appid：</span>
                    <div class="col-sm-8 input-group"><input class="form-control" name="appid" value="{{$client.wx_app.appid}}"></div>
                </div>
                <div class="form-group">
                    <span class="col-sm-2 control-label">secret：</span>
                    <div class="col-sm-8 input-group"><input class="form-control" name="secret" value="{{$client.wx_app.secret}}"></div>
                </div>
			</div>
			<div class="foot_btn_blank"></div>
            <div class="foot_btn">
                <div class="box">
                    <button type="submit" class="btn btn-primary">提交</button>
                </div>
            </div>
		</form>
	</div>
</div>
{{include file="layouts/_foot"}}
{{include file="shared/_jquery_validation"}}
<script type="text/javascript">
$("#form").validate({
	submitHandler:function(){
		layer.confirm('确认提交？', {
		    btn: ['确认','取消']
		}, function(){
			var load = layer.load();
			$("#form").ajaxSubmit(function(data) {
				layer.close(load);
				if (data.code == 401) {
                    goLogin();
                } else if (data.code == 200) {
                	layer.msg('操作成功', {time: 1500}, function() {window.location.reload();});
                } else if (data.code == 400) {
                    layer.msg(data.message);
                } else {
                    layer.msg('操作失败');
                }
			});
		});	
	},
    invalidHandler: function(form, validator) {
        goTop();
    }
});
</script>
</body>
</html>